package com.bb.blog.security.resource;

import com.alibaba.fastjson.JSONObject;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Map;

@Slf4j
@Component
public class OpaqueIntrospectorClientFallbackFactory implements FallbackFactory<OpaqueIntrospectorClient> {
    @Override
    public OpaqueIntrospectorClient create(Throwable cause) {
        log.info("opaque introspector 认证降级 ----------->token异常");
        return new OpaqueIntrospectorClient() {
            @Override
            public JSONObject introspect(String token) {
                log.info("opaque introspector 服务降级---------->");
                return null;
            }
        };
    }
}
